<!DOCTYPE html>
<html lang="en">
<head>
    <?php 
	include "includes/ketnoi.php";
	include "includes/header.php";
	?>
</head>

<body>
    <?php 
	include "includes/narbar.php";
	if(isset($_POST['Add']))
	  {
	  header("location:/ThemCongViec.php");
	  }
	?>
	<div class="container">
	
		<div class="row">
			<div class="panel-heading">
					<h3 class="panel-title">
					<table class="table table-striped">
					<tr style="background-color:infobackground">
								<th>Chi tiết công việc</th>
								</tr>
							</h3>
							</table>
						</div>
						
        <?php
		$id = $_GET['id'];
		
		$query = $conn->query("select * from jobs where id='$id'");
		
        while($row = mysqli_fetch_array($query))
        {?>
		<form action ="" method="post">
		<table class="table table-striped">
		<tr> 
		<td width="20%"><?php echo $row["title"]?></td>
		<td><?php echo "Ngày đăng: ".$row["created_at"]?></td>
		</tr>
        <tr>
        <td >Mô tả :</td>
		<td><?php echo $row["content"]?></td>
		</tr>
        <tr>
        <td >Mức lương :</td>
		<td><?php echo $row["salary"]." đ"?></td>
		</tr>
		<td >Kinh nghiệm :</td>
		<td><?php echo $row["exp"]." năm"?></td>
		</tr>
        <tr>
        <td >Hạn nộp :</td>
		<td><?php echo $row["expire_at"]?></td>
		</tr>   
		</table>
		<?php if($row["user_id"]=='1')
		{
		echo "<input type='submit' name='Add' value='Thêm'>";
		echo "   <input type='submit' name='Edit' value='Cập nhật'>";
		}
		else
		echo "";
	?>
	
       <?php }
	  
	   ?>
      	
	  <?php 
	     mysqli_close($conn);
        ?>
		</form>
        <br/>
       		</div>
				</div>
				

			
	</div>
	    <?php 
	include "includes/footer.php";
	?>
    </body>
</html>
